package com.dao.impl;

import java.util.List;

import com.dao.RollerDao;

public class RollerDaoImpl extends UniversalDaoImpl implements RollerDao{

	
	public List getListTree(String code) {
		String sql;
		if(code==null)
			sql = "select code id,concat('[',code,'] ',name) text,isLeaf leaf from roller where  parent_code is null and enabled is  true order by code";
		else
			sql = "select code id,concat('[',code,'] ',name) text,isLeaf leaf from roller where  parent_code='" + code+ "' and enabled is  true order by code";
		sql="select id,text,leaf from ("+sql+") as t";
		logger.info(sql);
		return getJdbcTemplate().queryForList(sql);
	}

	
	public List getListMenuTree(String rollerCode,String menuCode) {
		return null;
	}

	

}
